package com.woniu.api;

import com.woniu.dto.AllHisPrescriptionDto;
import com.woniu.dto.HisPatientDto;
import com.woniu.dto.PageDTO;
import com.woniu.param.ListHisPatientParam;
import com.woniu.param.LoginHisPatientParam;
import com.woniu.param.ModifyHisPatientParam;
import com.woniu.param.RegistratPatientParam;
import com.woniu.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@FeignClient(
        contextId = "patient-3",
        value = "patient",
        path = "/patient"
)
@Api(tags = "患者信息表接口")
public interface HisPatientQueryApi {
    //登录操作
    @ApiOperation("患者登录操作")
    @GetMapping("/login")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "loginHisPatientParam",value = "患者登录信息",required = false,
//                    dataType = "LoginHisPatientParam")
//    })
    Result<HisPatientDto> loginOperation(@RequestBody LoginHisPatientParam loginHisPatientParam);

    //注册操作
    @ApiOperation("患者注册操作")
    @PostMapping("registrat")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "registratPatientParam",value = "患者注册信息",required = false,
//                    dataType = "RegistratPatientParam")
//    })
    Result<HisPatientDto> registrationOperation(@RequestBody RegistratPatientParam registratPatientParam);

    //根据患者ID修改住院状态
    @ApiOperation("根据患者ID修改患者为住院状态")
    @PutMapping("statusbyid")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id",value = "患者ID",required = false,
//                    dataType = "Integer")
//    })
    Result<Boolean> modifyHospitalizationStatus(@RequestParam("id") Integer id);

    //根据患者ID来修改患者余额
    @PutMapping("modifybalance")
    @ApiOperation("根据患者ID和传入金额来修改患者余额")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "id,money",value = "患者ID,金额",required = false,
//                    dataType = "Integer")
//    })
    Result<Integer> modifyBalance(@RequestParam("id") Integer id,@RequestParam("money") Integer money);

    //根据条件修改其他信息
    @PutMapping("modifypatientinformation")
    @ApiOperation("根据条件修改其他信息")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "modifyHisPatientParam",value = "患者信息包含ID",required = false,
//                    dataType = "ModifyHisPatientParam")
//    })
    Result<HisPatientDto> modifyPatientInformation(@RequestBody ModifyHisPatientParam modifyHisPatientParam);

    //根据患者ID集合删除
    @DeleteMapping("deletepatient")
    @ApiOperation("根据患者ID集合删除")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "ids",value = "患者ID集合",required = false,
//                    dataType = "ArrayList")
//    })
    Result<Boolean> deletePatientInformation(@RequestParam("ids") ArrayList<Integer> ids);

    //根据条件查询
    @ApiOperation("根据条件查询")
    @GetMapping("getpatient")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "listHisPatientParam",value = "患者条件信息",required = false,
//                    dataType = "ListHisPatientParam")
//    })
    Result<PageDTO<HisPatientDto>> queryPatientInformation(@RequestBody ListHisPatientParam listHisPatientParam);



}
